﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;
namespace ConfExpert.Forms.Sistem
{
    public partial class Tatiller : XForm
    {
        public Tatiller()
        {
            InitializeComponent();
        }

        private void Tatiller_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetTatil");
            gridView1.FormatAsDate("Tarih");
            gridView1.MakeColumnInvisible("TatilId");
            gridView1.BestFitColumns();
            gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;


            gridView1.AddAutoIncrementalPK("TatilId");
            //gridView1.DataTable().SetPK("TatilId");
            //gridView1.DataTable().AddAutoIncrementalColumn("TatilId");
            barButtonItem1.ItemClick += barButtonItem1_ItemClick;
        }

        void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.EndEditing();
            gridView1.Update("TatilId,Tarih,Aciklama,TamYarim", "Tatil");
            gridView1.RefreshDataSource("GetTatil");
            gridView1.BestFitColumns();
            Notify("Kaydedildi");
        }
    }
}
